/*
 * @Description: 设备管理
 */
import request from '@/utils/request'
export default {
  /**
   * @description: 获取所有数据项列表 *代表必填
   * @param {String/Number} page
   * @param {String/Number} size
   */
  getDataItemByList(params) {
    return request.get(`/v3/iot/iotPlatform/queryRtuByCompanyMark?companyMark=${params}`)
  },
  getDataTreeList() {
    return request.get(`/iotApplication/ownership/queryTreeByCompanyMark?companyMark=${sessionStorage.organizationNo}`)
  },

  /**
   * @description: 获取设备列表 *代表必填
   * @param {Object}  *
   */
  queryPageByCondition(params) {
    return request.post('/v3/iot/device/queryPageByCondition', {
      page: params.page,
      size: params.size,
      entity: params.entity
    });
  },
  /**
   * @description: 批量添加
   * @param {Object}  *
   */
  addFarmingTypelist(params) {
    return request.post('/v3/iot/device/add', params);
  },
  /**
  * @description: 批量编辑
  * @param {Object}  *
  */
  editFarmingTypelist(params) {
    return request.post('/v3/iot/device/edit', params);
  },
  /**
   * @description: 批量删除
   * @param {Object}  *
   */
  delFarmingTypelist(params) {
    return request.get(`/v3/iot/device/delByNo?no=${params}`);
  },
  /**
   * @description: 批量删除类型
   * @param {Object}  *
   */
  delListFarmingTypelist(params) {
    return request.post(`/v3/iot/device/delListByNo`, params);
  },
  /**
   * @description: 通过农场id查询农场所拥有的农业类型
   * @param {Object}  *
   */
  queryCondFarmingTypelist() {
    return request.post('/v3/organization/base/farmingType/queryByCondition');
  }
};
